namespace cpputils
{

class command_line_arguments
{
public:
	struct option_arguments
	{
		friend class command_line_arguments;
	public:
		bool empty() const;
		int size() const;
		const string& operator[](int I) const;
		const string& get() const;
		string get_or_default(const string& Default) const;
		const vector<string>& get_all() const;

	private:
		command_line_option Opt;
		vector<string> Args;

		void add(const string& S);
		string get_option_name() const;
	};

	command_line_arguments();
	command_line_arguments(const command_line_options& Opts, subarray<const command_line_argument> Args);
	void clear();
	void build(const command_line_options& Opts, subarray<const command_line_argument> Args);
	bool empty() const;
	const option_arguments& operator[](const string& S) const;
	option_arguments& operator[](const string& S);

private:
	bool Empty;
	vector<option_arguments> OptArgs;
	smart_ptr<option_arguments> CmdLineArgs;
	map<string, int> OptMap;
};

}
